package com.inspinia.base.common.model;

/**
 * 默认状态
 * Created by veblen on 16-1-27.
 */
public enum Status implements NameCodeEnum {
    normal(1, "正常"), disabled(2, "停用");

    private final int code;
    private final String name;

    Status(int code, String name) {
        this.code = code;
        this.name = name;
    }

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getName() {
        return name;
    }

    public static Status valueOf(int code) {
        for (Status us : Status.values()) {
            if (us.getCode() == code) {
                return us;
            }
        }
        return null;
    }

}
